<?php
	$protectid="2"; 
	include("../protect.php");
	
	//include_once("../../fckeditor/fckeditor.php");
	include_once("../../config.inc.php");
	
	
	include_once(CFG_LIB_DIR.'mysqldb.inc.php');		
	$objDb = new mysqldb();
	if($_GET['Lang'])
	{
	$Lang = $_GET['Lang'];
	}else{
	$Lang = "cn";
	}
	
	$strSQL = "SELECT * FROM `".con_strPREFIX."copyright` WHERE `Lang`='".$Lang."' LIMIT 1";
	$objDb->query($strSQL);
	$tmpResult = $objDb->get_data();
	$RightResult = $tmpResult[0];
	if($RightResult)
	{
		$strAct = "modify";
	}else{
		$strAct = "add";
	}
	$strOperation = ( $strAct == "add" ) ? "添加" : "修改";

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $strOperation; ?>网站信息</title>
<script type="text/javascript" src="../../ueditor/editor_config.js"></script>
<script type="text/javascript" src="../../ueditor/editor_all.js"></script>
<?php include_once("../common/files.php"); ?>

<script type="text/javascript">
	function validForm()
	{
		var arrNotBlankElement = new Array("infoTitleTr", "sortTr", "topTr", "extractTr", "publishDateTr");
		if(validNotBlank(arrNotBlankElement) == false)
			return false;
			
		var arrDateElementID = new Array("PublishDate");
		if(validDate(arrDateElementID) == false)
			return false;
			
		var arrNumElementID = new Array("SortNum", "TopNum", "ExtractNum");
		if(validSortNum(arrNumElementID) == false)
			return false;
			
		return true;
	}
</script>
</head>

<body id="main" >
<table summary="" id="pagehead" cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td><h1><?php echo $strOperation; ?>网站信息</h1></td>
		<td class="actions">
			<table summary="" cellpadding="0" cellspacing="0" border="0" align="right">
				<tr>
          <td class="active"><a href="#" ><?php echo $strOperation; ?>网站信息</a></td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<table width="100%">
  <tr>
  	<td>
      <div id="listtab">
        <div class="listtab"><a href="copyright.php?Lang=cn" <?php if($Lang != "en"){?>class="active"<?php }?>><img src="../images/icon_folder.gif" align="absmiddle">　中文版</a></div>
        <div class="listtab"><a href="copyright.php?Lang=en"  <?php if($Lang == "en"){?>class="active"<?php }?>><img src="../images/icon_folder.gif" align="absmiddle">　英文版</a></div>
      </div>
  	</td>
  </tr>
</table>

<form name="infoadd" method="post" action="copyright_ok.php?act=<?php echo $strAct; ?>&id=<?php echo $strID; ?>" onsubmit="return validForm();">
<div id="TabsAll">
<div id="Tab_1"> 
<table cellspacing="0" cellpadding="0" width="100%"  class="maintable">

  <tr>
    <th width="20%">ICO图片</th>
    <td width="82%">
    <input name="Lang" type="hidden" id="Lang" size="60" value="<?php echo $Lang; ?>" />
    	<input name="ICO" type="text" id="ICO" size="60" value="<?php echo $RightResult['ICO']; ?>" />&nbsp;&nbsp;
      <span class="buttons">
        <input type="button" value="上传"  onclick="PopupWindow('../upload.php?dir=16&input=ICO', 380, 140);" class="submit">
        <input type="button" value="选择" onclick="PopupWindow('../pic_list.php?dir=16&input=ICO', 712, 600);">
			</span>	<br />
<span>宽高48*48，ICO图片后缀必须为.ico在网页上才能正常显示</span>	</td>
  </tr>
	<tr >
    <th>网站标题(Title)</th>
    <td>
      <label>
      <textarea name="Title" id="Title" style="width:300px; height:100px;"><?php echo $RightResult['Title']?></textarea>
      </label>		</td>
  </tr>
	<tr >
    <th>关键字(Keywords )</th>
    <td>
      <label>
      <textarea name="Keywords" id="Keywords" style="width:300px; height:100px;"><?php echo $RightResult['Keywords']?></textarea>
      </label>		</td>
  </tr>
	<tr >
    <th>描述(Description )</th>
    <td>
      <label>
      <textarea name="Description" id="Description" style="width:300px; height:100px;"><?php echo $RightResult['Description']?></textarea>
      </label>		</td>
  </tr>
	<tr >
    <th>标注版权(Copyright )</th>
    <td>
      <label>
      <textarea name="CopyRight" id="CopyRight" style="width:300px; height:100px;"><?php echo $RightResult['CopyRight']?></textarea>
      </label>		</td>
  </tr>
	<tr>
		<th>底部信息</th>
		<td>
		
        <textarea name="BottomInfo" id="Note"><?=$RightResult['BottomInfo']?></textarea>
<script type="text/javascript">
    var editor = new UE.ui.Editor({
    	toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold']]
    	//更多其他参数，请参考editor_config.js中的配置项
    	});

    
    editor.render("Note");
  
</script>
       </td>
	</tr>
</table>
</div>



</div>

<div class="buttons">
	<input type="submit" value="提交保存" class="submit">
	<input type="reset" value="重新设置">
</div>

</form>
<br>
<?php include "../bottom.php"; ?>
</div>
</body>
</html>
<?php $objDb->close(); ?>